package com.itheima.阻塞队列BlockingQueue.吃;

import java.util.concurrent.ArrayBlockingQueue;

public class Demo {
    public static void main(String[] args) {
        ArrayBlockingQueue<String>list=new ArrayBlockingQueue<>(1);

        Cooker c = new Cooker(list);
        Foodie f = new Foodie(list);
    }
}



class Cooker extends Thread{
    private ArrayBlockingQueue<String>list;

    public Cooker(ArrayBlockingQueue<String> list) {

    }

    @Override
    public void run() {
    int count=0;
    while (true){
        if (count>=10){
            break;
        }else {

        }
    }
    }
}



class Foodie extends Thread{
    private ArrayBlockingQueue<String> list;

    public Foodie(ArrayBlockingQueue<String> list) {
    }

    @Override
    public void run() {

    }
}
